home *** CD-ROM | disk | FTP | other *** search
/ PC World 2006 November / PCWorld_2006-11_cd.bin / v cisle / feedreader / FeedReader306Setup.exe / {app} / stylesheet / custom(delicious).xsl < prev    next >
Extensible Markup Language  |  2006-07-31  |  7KB  |  264 lines

  1. ∩╗┐<?xml version="1.0" ?>
  2.  
  3. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4.                 xmlns:feed="http://www.w3.org/2005/Atom"
  5.                 xmlns:fr="http://www.feedreader.com/ns/3.0"
  6.                 version="1.0">
  7. <xsl:output method="html" />
  8.  
  9.  
  10.  <xsl:template name="replace">
  11.   <xsl:param name="text-string"/>
  12.   <xsl:param name="find-word"/>
  13.   <xsl:param name="replace-with"/>
  14.   <xsl:choose>
  15.    <xsl:when test="contains($text-string,$find-word)">
  16.     <xsl:call-template name="replace">
  17.      <xsl:with-param name="text-string" select="concat(substring-before($text-string,$find-word),$replace-with,substring-after($text-string,$find-word))"/>
  18.      <xsl:with-param name="find-word" select="$find-word"/>
  19.      <xsl:with-param name="replace-with" select="$replace-with"/>
  20.     </xsl:call-template>
  21.    </xsl:when>
  22.    <xsl:otherwise>
  23.     <xsl:value-of select="$text-string"/>
  24.    </xsl:otherwise>
  25.   </xsl:choose>
  26.  </xsl:template>
  27.  
  28. <xsl:template match="/">
  29.  
  30. <html>
  31.   <head>
  32.     <title><xsl:value-of select="/feed:feed/feed:title"/></title>
  33.     <link rel="stylesheet" href="atom.css"/>
  34.     <style>
  35.  
  36. body {
  37.  font-family: verdana, tahoma;
  38.  font-size: 0.7em;
  39.  line-height: 1.3em;
  40.  padding: 0;
  41.  margin: 0;
  42. }
  43.  
  44.  
  45. a, a:link, a:active, a:visited {
  46.  text-decoration: none;
  47.  color: #0088ff;
  48. }
  49.  
  50. div.entry {
  51.  padding: 0 20px 20px 25px;
  52.  border-bottom: 1px solid #ddd;
  53. }
  54.  
  55. div.content img {
  56. }
  57.  
  58. div.active {
  59.  background-color: #f1f5fa;;
  60. }
  61.  
  62. .read .title a {
  63.  color: #aaa;
  64. }
  65.  
  66.  
  67. .read .content {
  68.  color: #555;
  69. }
  70.  
  71. div.entry .read .title a {
  72.  color: gray;
  73. }
  74.  
  75. .header {
  76.  padding-top: 20px;
  77.  margin: 0 0 0.2em 0;
  78. }
  79.  
  80. .title {
  81.  font-size: 1.6em;
  82.  font-family: arial, verdana, tahoma;
  83.  font-weight: bold;
  84.  letter-spacing: -1px;
  85.  line-height: 1.1em;
  86. }
  87.  
  88. div.details {
  89.  color: gray;
  90.  margin-bottom: 0.5em;
  91. }
  92. div.clear {
  93.  clear:both;
  94.  height: 1px;
  95.  width: 1px;
  96.  font-size: 1px;
  97.  line-height: 1px;
  98. }
  99. span.modified, span.author, span.category {
  100. }
  101.  
  102. .status a {
  103.  display:block;
  104.  line-height: 0;
  105.  font-size: 0;
  106.  width: 8px; 
  107.  height: 8px;
  108.  margin-top: -1.5em;
  109.  background-image: url('<xsl:value-of select="/feed:feed/fr:imagebase"/>stylesheet/unread_8x8.png');
  110.  background-repeat: no-repeat;
  111. }
  112.  
  113. .read .status a {
  114.  background-image: url('<xsl:value-of select="/feed:feed/fr:imagebase"/>stylesheet/read_8x8.png');
  115. }
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122. </style>
  123.     
  124.  
  125.   </head>    
  126.   <body>
  127.   <script type="text/javascript">
  128.   var imagebase='file://<xsl:value-of select="/feed:feed/fr:imagebase"/>';
  129.   </script>
  130.   <xsl:apply-templates select="feed:feed"/>
  131.   </body>
  132. </html>
  133. </xsl:template>
  134.  
  135. <xsl:template match="feed:feed">
  136.   <xsl:apply-templates select="feed:entry"/>
  137. </xsl:template>
  138.  
  139. <xsl:template match="feed:entry">
  140.           <base>
  141.               <xsl:attribute name="href"><xsl:value-of select = "feed:source/feed:link[@rel='alternate'][1]/@href"/>/</xsl:attribute>
  142.             </base>
  143.     <div class="entry">
  144.         <xsl:attribute name="id">article<xsl:value-of select="fr:item_id"/></xsl:attribute>
  145.         <xsl:if test="fr:rtlEnabled = 1">
  146.             <xsl:attribute name="style">direction:RTL;</xsl:attribute>
  147.         </xsl:if>
  148.         <xsl:if test="fr:status = 1">
  149.             <xsl:attribute name="class">entry read</xsl:attribute>
  150.         </xsl:if>
  151.                 
  152.         <div class="header">
  153.  
  154.         <span class="title">
  155.             <a>
  156.             <xsl:attribute name="href"><xsl:value-of select="feed:link/@href"/></xsl:attribute>
  157.             <xsl:value-of select="feed:title"/>
  158.             </a>
  159.  
  160.             <a>
  161.             <xsl:attribute name="target">_new</xsl:attribute>
  162.             <xsl:attribute name="href">http://del.icio.us/post?url=<xsl:value-of select="feed:link/@href"/>&title=
  163. <xsl:call-template name="replace">
  164.    <xsl:with-param name="text-string" select="feed:title"/>
  165.    <xsl:with-param name="find-word" select="' '"/>
  166.    <xsl:with-param name="replace-with" select="'%20'"/>
  167.   </xsl:call-template>
  168. </xsl:attribute>
  169.             <img>
  170.             <xsl:attribute name="border">0</xsl:attribute>
  171.             <xsl:attribute name="hspace">5</xsl:attribute>
  172.             <xsl:attribute name="src">file://<xsl:value-of select="/feed:feed/fr:imagebase"/>stylesheet/delicious.gif</xsl:attribute>
  173.             </img>            
  174.             </a>
  175.         </span>
  176.  
  177.           <span class="status">
  178.           <xsl:attribute name="style">float:right;</xsl:attribute>
  179.           <xsl:if test="fr:rtlEnabled = 1">
  180.             <xsl:attribute name="style">float:left;</xsl:attribute>
  181.           </xsl:if>
  182.           <xsl:if test="fr:rtlEnabled != 1">
  183.             <xsl:attribute name="style">float:right;</xsl:attribute>
  184.           </xsl:if>
  185.           
  186.           <a>
  187.              
  188.           <xsl:attribute name="id">togglelink<xsl:value-of select="fr:item_id"/></xsl:attribute>
  189.             <xsl:attribute name="href">fr:toggleread/<xsl:value-of select="fr:item_id"/></xsl:attribute>
  190.           <xsl:attribute name="onclick">this.blur();</xsl:attribute>
  191.                    
  192.           </a>
  193.           </span>
  194.         </div>
  195.     
  196.                 <div class="details">
  197.              <span class="updated"><xsl:value-of select="fr:updated"/>, </span>        
  198.             <xsl:if test="feed:author"> 
  199.                   <span class="author">
  200.                 <xsl:apply-templates select="feed:author"/>
  201.                 </span>
  202.             </xsl:if>
  203.             <a>
  204.             <xsl:attribute name="href">fr:edittags/<xsl:value-of select="fr:item_id"/></xsl:attribute>
  205.  
  206.             <img>
  207.             <xsl:attribute name="border">0</xsl:attribute>
  208.             <xsl:attribute name="hspace">5</xsl:attribute>
  209.             <xsl:attribute name="src">file://<xsl:value-of select="/feed:feed/fr:imagebase"/>stylesheet/tag_edit.png</xsl:attribute>
  210.             </img>
  211.             </a>
  212.                         
  213.             <xsl:if test="feed:category">
  214.                   <span class="category"> 
  215.                   <xsl:apply-templates select="feed:category"/>
  216.                 </span>
  217.                     </xsl:if>
  218.             <xsl:if test="feed:source">
  219.                   <span class="source"> 
  220.                 <a>
  221.                 <xsl:attribute name="href">fr:feed/<xsl:value-of select="feed:source/fr:feed_id"/></xsl:attribute>
  222.                 <xsl:value-of select="feed:source/feed:title"/>
  223.                 </a>
  224.                 <a>
  225.                 <xsl:attribute name="href">
  226.                 <!-- <xsl:for-each select = "feed:source/feed:link[@rel='alternate']"> --> 
  227.                     <xsl:value-of select = "feed:source/feed:link[@rel='alternate'][1]/@href"/> 
  228.                     <!-- </xsl:for-each> -->
  229.                 </xsl:attribute>
  230.                       
  231.             <img>
  232.             <xsl:attribute name="border">0</xsl:attribute>
  233.             <xsl:attribute name="hspace">5</xsl:attribute>
  234.             <xsl:attribute name="src">file://<xsl:value-of select="/feed:feed/fr:imagebase"/>stylesheet/world_go.png</xsl:attribute>
  235.             </img>
  236.                 </a>                                  
  237.                 </span>
  238.                                 
  239.                     </xsl:if>
  240.         </div>
  241.  
  242.     <xsl:if test="feed:content">
  243.         <div class="content">
  244.             <xsl:value-of disable-output-escaping="yes" select="feed:content"/>
  245.         </div>
  246.     </xsl:if>
  247.     <div class="clear" />
  248.     </div>
  249.  
  250. </xsl:template>
  251.  
  252. <xsl:template match="feed:category">
  253.   <a>
  254.   <xsl:attribute name="href">fr:<xsl:value-of select="./@scheme"/></xsl:attribute>
  255.   <xsl:value-of select="./@term"/>
  256.   </a>, 
  257. </xsl:template>
  258.  
  259. <xsl:template match="feed:author">
  260.   <xsl:value-of select="feed:name"/>, 
  261. </xsl:template>
  262.  
  263. </xsl:stylesheet>
  264.